//
// Created by xili on 2024/9/19 11:00.
// GO BIG OR GO HOME.
//
#include "leetcode.h"

class Solution {
public:
    string maximumOddBinaryNumber(string s) {
        int cnt0 = 0;
        int cnt1 = 0;
        for (auto &it: s) {
            if (it == '0') {
                cnt0++;
            } else {
                cnt1++;
            }
        }
        string ans = "";
        while (cnt1-- > 1) {
            ans += "1";
        }
        while (cnt0--) {
            ans += "0";
        }
        return ans + "1";
    }
};